package com.woody.aggregate.msgsendrule.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * &copy; All rights Reserved
 *
 * @author wénkǎi.zhāng 2025-03-18
 */
@Data
@ApiModel
public class SaveMsgSendRuleReq {
    @ApiModelProperty(value = "规则id，编辑时必填", example = "1")
    private Integer ruleId;

    @ApiModelProperty(value = "规则名称", required = true, example = "所有商家都可查看")
    @NotBlank(message = "规则名称不能为空")
    @Length(max = 255, message = "规则名称不能超过255个字符")
    private String ruleName;

    @ApiModelProperty(value = "分类id", required = true, example = "1")
    @NotNull(message = "分类id不能为空")
    private Integer categoryId;

    @ApiModelProperty(value = "推送频率：1=每天一次;2=仅一次", allowableValues = "1,2", required = true, example = "1")
    @NotNull(message = "推送频率不能为空")
    private Integer frequency;

    @ApiModelProperty(value = "目标受众：1=全部用户;2=指定用户", allowableValues = "1,2", required = true, example = "1" )
    @NotNull(message = "目标受众不能为空")
    private Integer userScope;

    @ApiModelProperty(value = "用户类型：1=店铺", required = true, example = "1")
    @NotNull(message = "用户类型不能为空")
    private Integer userType;

    @ApiModelProperty("推送时间类型：1=立即推送；2=定时推送")
    @NotNull(message = "推送时间类型不能为空")
    private Integer startType;

    @ApiModelProperty(value = "定时推送时必传")
    private Date startTime;

    @ApiModelProperty("操作人用户id")
    @NotNull(message = "操作人用户id不能为空")
    private Long operatorUserId;

    @ApiModelProperty(value = "用户列表，新增规则且指定用户推送时必传，修改规则时此字段无效")
    private List<Long> userIds;

}
